﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TSqlServer;

public partial class user_user_reback_pwd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
        }
        else
        {
            btnReset.Attributes.Add("OnClick", "javascript:return chk();");
        }
    }
    protected void btnReset_Click(object sender, EventArgs e)
    {
        string sSql = "select count(*) from t_user where email='" + email.Text + "' and status=1";
        if (TSqlDB.ExecuteScalar(sSql) > 0)
        {
            TCommon.mySendMail_Reset(email.Text);
            this.Response.Redirect("user_reback_ok.aspx?email=" + email.Text);
        }
        else
        {
            string sHtml = "alert('邮件地址不存在！')";
            ClientScript.RegisterStartupScript(this.GetType(), "script11", sHtml, true);
        }
    }
}
